﻿System.Gadget.onSettingsClosing = settingsClosing;

function loadSettings()
{
    var lows = System.Gadget.Settings.read("Interval");
        
    if (lows != "") 
    {
        low.value = lows;
    } 
    else
    {
        low.value = 15;
    }    
} 

function settingsClosing(event) 
{ 
  if (event.closeAction == event.Action.commit) 
  {
    var checked = false;
    
    var lows = low.value.toString(10);
    if (lows != "")
    {
        lows = lows.replace("/\D/","");
        checked=true;
    }
    if (checked)
    {
        System.Gadget.Settings.write("Interval",lows);
    }
    else
    {
        event.cancel = true;
		return;
    }
  }
}

